Refactor: extract SettingsTab metadata out of PreferencesView#14
Merged
Conversation
PreferencesView nested a private SettingsTab enum carrying each pane's presentation metadata (sidebar icon/tint/label + page subtitle). Lift it to a top-level value type so the mapping is plain, reusable, and testable instead of buried in view-private code. Only SettingsPage's qualified reference (PreferencesView.SettingsTab) needed updating. Behavior-preserving. Adds SettingsTabTests (4 cases): all six tabs in order, non-empty metadata for each, unique labels/icons, and spot checks.
GamalAnwar
added a commit
that referenced
this pull request
Jun 18, 2026
Lift PreferencesView's nested private SettingsTab enum (sidebar icon/tint/label + page subtitle for each pane) to a top-level testable value type. Only SettingsPage's qualified reference needed updating. Behavior-preserving. Adds SettingsTabTests (4 cases). CI green.
GamalAnwar
added a commit
that referenced
this pull request
Jun 18, 2026
Lift PreferencesView's nested private SettingsTab enum (sidebar icon/tint/label + page subtitle for each pane) to a top-level testable value type. Only SettingsPage's qualified reference needed updating. Behavior-preserving. Adds SettingsTabTests (4 cases). CI green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Target 3 (PreferencesWindow decomposition), first step.
PreferencesViewnested a privateSettingsTabenum carrying each pane's presentation metadata — sidebaricon/tint/labeland the pagesubtitle. This lifts it to a top-level value type (Views/SettingsTab.swift) so the mapping is plain, reusable, and testable instead of buried in view-private code.Only one reference needed touching:
SettingsPage's qualifiedPreferencesView.SettingsTab→SettingsTab. All other uses (@State selectedTab,ForEach(SettingsTab.allCases), thedetailswitch) resolve to the top-level enum unchanged.Scope / safety
Tests
SettingsTabTests(4 cases): all six tabs present in order, non-emptyicon/label/subtitlefor every case, unique labels & icons, and spot checks.Note on the rest of target 3
The remaining part — splitting the six inline tab bodies (
generalTab…advancedTab) into separateViewstructs — is pure mechanical churn with no test-coverage benefit (it's view code), and a bulk ~450-line move carries real compile risk without a local build. The tabs already compose the sharedSettingsCard/SettingsRow/ToggleRowcomponents, so they're not as monolithic as the line count suggests. I scoped this PR to the testable extraction; happy to do the body split as a focused follow-up (one tab per PR to keep each reviewable) if you want it — just say so.🤖 Generated with Claude Code
Generated by Claude Code